package pikasial.graphique;

import pikasial.images.ImageContainer;
import pikasial.images.PikImage;

public class PressePapier {

	private PikImage[] objets;
	private ImageContainer albumDOrigine;
	private static final PressePapier instance = new PressePapier();

	private PressePapier() {

	}

	public static PressePapier getInstance() { return instance; }

	public boolean isEmpty() { return objets == null; }

	public void vider() { objets = null; albumDOrigine = null; }

	public void couper(PikImage[] pik,ImageContainer origine) {
		objets = pik;
		albumDOrigine = origine;
	}

	public void copier(PikImage[] pik) {
		objets = pik;
		albumDOrigine = null;
	}

	public PikImage[] coller() {
		if (albumDOrigine != null) {
			for (PikImage pik : objets)
				albumDOrigine.removeImage(pik);
		}
		return objets;
	}

}
